﻿@{this.Init(layout:"~/_SiteLayout.cshtml", title:"Log In", action:Account.Login.Init);}
<p>
   Please enter your username and password below. If you don't have an account,
   visit the <a href="@Href("~/Account/Register")">registration page</a> and create one.
</p>

@* If one or more validation errors exist, show an error *@
@if (!Page.IsValid) {
   <p class="message error">There was a problem with your login and/or errors exist in your form.</p>
}

<form method="post" action="">
    <fieldset>
        <legend>Log In to Your Account</legend>
        <ol>            
            <li class="username">
                <label for="username">Email:</label>
                <input type="text" id="username" name="username" value="@Page.Model.Username" title="Username" @if(Page.Errors.Username.IsError){<text>class="error-field"</text>} />                
                @if (Page.Errors.Username.IsError)
                {
                <label for="username" class="validation-error">
                    @Page.Errors.Username.Message;
                </label>
                }
            </li>            
            <li class="password">
                <label for="password">Password:</label>
                <input type="password" id="password" name="password" title="Password" @if (Page.Errors.Password.IsError){<text>class="error-field"</text>} />                
                @if (Page.Errors.Password.IsError){
                <label for="password" class="validation-error">
                    @Page.Errors.Password.Message;
                </label>
                }
            </li>
            <li class="remember-me">
                <label class="checkbox" for="rememberMe">Remember Me?</label>
                <input type="checkbox" id="rememberMe" name="rememberMe" value="true" title="Remember Me" @if(Page.Model.RememberMe){<text>checked="checked"</text>} />
            </li>
        </ol>
        <p class="form-actions">
            <input type="submit" value="login" title="Login"/>
        </p>
        <p><a href="@Href("~/Account/ForgotPassword")">Did you forget your password?</a></p>
    </fieldset>
</form>